package com.example.cny.adapter;

import android.media.Image;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseViewHolder;
import com.example.cny.R;
import com.example.mylibrary.base.BaseAdapter;
import com.example.mylibrary.db.bean.BluetoothBean;
import com.example.mylibrary.db.bean.FunctionBean;

import java.util.List;

public class FunctionListAdapter extends BaseAdapter<FunctionBean, BaseViewHolder> {
    public FunctionListAdapter(int layoutResId, @Nullable List<FunctionBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, FunctionBean item) {
        ((ImageView)helper.getView(R.id.function_item_bg)).setImageResource(item.getBgRes());
        ((ImageView)helper.getView(R.id.function_item_icon)).setImageResource(item.getIconRes());
        ((TextView) helper.getView(R.id.function_item_title)).setText(item.getFunction());
        ((TextView)helper.getView(R.id.function_item_bg)).setText(item.getText());

    }
}
